<?php

namespace app\agentapi\model;

use think\Db;

/**
 * 地区管理控制器
 * Class Region
 * @package app\store\model
 */
class Region extends Base
{

    protected $name = 'region';

    protected  $hidden = ['shortname','merger_name','pinyin','code','zip_code','first','lng','lat','level'];

    /**
     * 省份列表
     * @param $user
     * @param $item
     * @return array
     * @throws \think\exception\DbException
     */
    public function provinceList()
    {

        $data = $this->all(['level'=>1]);
        return $data;
    }


    /**
     * 城市列表
     * @param $user
     * @param $item
     * @return array
     * @throws \think\exception\DbException
     */
    public function otherList($param)
    {
        $data = $this->all(['pid'=>$param['id']]);
        return $data;
    }


}
